package ttOrder.service;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import ttOrder.dao.inter.FoodTypeMapper;
import ttOrder.model.po.FoodType;

@Service
@Transactional
public class FoodTypeServiceImpl extends abstractService<FoodType>{

	@Autowired
	private FoodTypeMapper foodTypeMapper;

	@Override
	public List<FoodType> getAll() {
		return foodTypeMapper.selectAll();
	}

	@Override
	public List<FoodType> getByEntity(FoodType record) {
		return foodTypeMapper.select(record);
	}

	@Override
	public FoodType getByKey(FoodType key) {
		return foodTypeMapper.selectByPrimaryKey(key);
	}

	@Override
	public int insert(FoodType record) {
		return foodTypeMapper.insert(record);
	}

	@Override
	public int update(FoodType record) {
		return foodTypeMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int deleteByKey(FoodType key) {
		return foodTypeMapper.deleteByPrimaryKey(key);
	}

	@Override
	public int deleteByEntity(FoodType record) {
		return foodTypeMapper.delete(record);
	}

	@Override
	public int getCount(FoodType record) {
		return foodTypeMapper.selectCount(record);
	}

}
